<?php
/**
 * Created by PhpStorm.
 * User: cong.ding
 * Date: 2017/10/10
 * Time: 10:02
 */

include_once("DBUtil.php");

$db =new DBUtil();

$sql = "select * from type_mst";
$result = $db->query($sql);
$result_array =[];
if ($result->num_rows > 0) {
  while($row = $result->fetch_assoc()) {
    array_push($result_array,$row);
  }
}
$result = ["data"=>$result_array];
echo json_encode($result);